-
Notifications
You must be signed in to change notification settings - Fork 121
[Woo POS][Barcodes] Timeout a partial scan with no terminating character #15952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Woo POS][Barcodes] Timeout a partial scan with no terminating character #15952
Conversation
If there's an unfinished scan, show the error row after waiting for the last inter-character timeout, not when the next character is received.
|
|
|
@staskus I brought the Android tablet + scanner to test i2 and don't have the iPad device for testing this PR today while working outside. Please let me know if it's urgent, and I can review the PR later today. Otherwise, I will review it tomorrow if it's still open. |
|
@jaclync not urgent, good to merge by the end of the week. |
jaclync
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "pointOfSale.barcodeScan.error.incompleteScan", | ||
| value: "Partial barcode scan", | ||
| comment: "Error message shown when scan is incomplete." | ||
| "pointOfSale.barcodeScan.error.incompleteScan2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: I think the convention in the code base before I started following it is *.versionNumber but it's really a minor detail that is internal to the code base.
| "pointOfSale.barcodeScan.error.incompleteScan2", | |
| "pointOfSale.barcodeScan.error.incompleteScan.2", |
|
|
||
| final class MockTimer: Timer { | ||
| var isCancelled = false | ||
| let mockTimeProvider: MockTimeProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could there be a retain cycle between MockTimeProvider and MockTimer since they hold on to each other? Not sure if it's worth keeping one as weak var.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good observation, it would create retain cycles. We can make it weak to avoid some issues in tests.
| } | ||
|
|
||
| @Test("proactive timeout triggers error without next character") | ||
| func timeout_whenTimerFires_triggersTimeoutError() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: the test function names feel like an interesting mix of snake & camel case 😆


Description
WOOMOB-765
Related Android PR: woocommerce/woocommerce-android#14255
If there's an unfinished scan, show the error row after waiting for the last inter-character timeout, not when the next character is received.
Solution
Steps to reproduce
Prerequisites: check the scanner settings to disable a terminating character or use an external keyboard for testing input without a terminator
Testing information
Tested on iPadOS 26 with an Inateck scanner
Screenshots
ScreenRecording_07-26-2025.20-14-40_1.mov
RELEASE-NOTES.txtif necessary.